from mall import settings
from alipay import AliPay

def Generate_alipay_handler():
    # 创建支付对象
    alipay = AliPay(
        appid=settings.ALIPAY_APPID,
        app_notify_url=None,  # 默认回调url
        app_private_key_path=settings.APP_PRIVATE_KEY_PATH,
        alipay_public_key_path=settings.ALIPAY_PUBLIC_KEY_PATH,
        sign_type='RSA2',  # RSA 或者 RSA2
        debug=settings.ALIPAY_DEBUG
    )
    return alipay